home *** CD-ROM | disk | FTP | other *** search
/ CD Classic 39 / CD CLASSIC #39 (1998).iso / EMPRESA / visio / Vistdstd / Install / Data.Z / Netdiag.FRM (.txt) < prev    next >
Visual Basic Form  |  1996-09-03  |  5KB  |  129 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMainForm 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H0080FFFF&
  5.    BorderStyle     =   3  'Fixed Dialog
  6.    Caption         =   "Network Diagramming"
  7.    ClientHeight    =   1905
  8.    ClientLeft      =   780
  9.    ClientTop       =   1800
  10.    ClientWidth     =   5115
  11.    BeginProperty Font 
  12.       name            =   "MS Sans Serif"
  13.       charset         =   0
  14.       weight          =   700
  15.       size            =   8.25
  16.       underline       =   0   'False
  17.       italic          =   0   'False
  18.       strikethrough   =   0   'False
  19.    EndProperty
  20.    ForeColor       =   &H80000008&
  21.    Height          =   2595
  22.    Icon            =   "NETDIAG.frx":0000
  23.    Left            =   720
  24.    LinkTopic       =   "Form1"
  25.    MaxButton       =   0   'False
  26.    ScaleHeight     =   1905
  27.    ScaleWidth      =   5115
  28.    Top             =   1170
  29.    Width           =   5235
  30.    Begin MSComDlg.CommonDialog ctlCDialog 
  31.       Left            =   480
  32.       Top             =   600
  33.       _Version        =   65536
  34.       _ExtentX        =   847
  35.       _ExtentY        =   847
  36.       _StockProps     =   0
  37.    End
  38.    Begin VB.Menu mnuFile 
  39.       Caption         =   "&File"
  40.       Begin VB.Menu mnuFileNewDBase 
  41.          Caption         =   "&New Database..."
  42.       End
  43.       Begin VB.Menu mnuFileOpen 
  44.          Caption         =   "&Open Database..."
  45.       End
  46.       Begin VB.Menu mnuFileSep1 
  47.          Caption         =   "-"
  48.       End
  49.       Begin VB.Menu mnuFileExit 
  50.          Caption         =   "E&xit"
  51.       End
  52.    End
  53. Attribute VB_Name = "frmMainForm"
  54. Attribute VB_Creatable = False
  55. Attribute VB_Exposed = False
  56. ' -----------------------------------------------------------------------------
  57. ' Copyright (C) 1993-1996 Visio Corporation. All rights reserved.
  58. ' You have a royalty-free right to use, modify, reproduce and distribute
  59. ' the Sample Application Files (and/or any modified version) in any way
  60. ' you find useful, provided that you agree that Visio has no warranty,
  61. ' obligations or liability for any Sample Application Files.
  62. ' -----------------------------------------------------------------------------
  63. Option Explicit
  64. Private Sub mnuFileExit_Click()
  65. '----------------------------------------
  66. '--- mnuFileExit_Click ------------------
  67. '--   Handles request for exit.  We prompt before exiting.
  68.     Dim strMsg As String
  69.     strMsg = "Are you sure you want to quit?"
  70.     If MsgBox(strMsg, MB_ICONEXCLAMATION Or MB_YESNO, "Exit") = IDYES Then
  71.         End
  72.     End If
  73. End Sub
  74. Private Sub mnuFileNewDBase_Click()
  75. '----------------------------------------
  76. '--- mnuFileNewDBase_Click --------------
  77. '--   Handles the user's request to build a blank database.
  78.     On Error GoTo lblNewDBaseCatchCancelErr
  79.     Dim strFileName As String
  80.     ctlCDialog.DialogTitle = "Create Blank Database"
  81.     ctlCDialog.CancelError = True
  82.     ctlCDialog.Flags = OFN_HIDEREADONLY Or OFN_OVERWRITEPROMPT
  83.     ctlCDialog.Filter = "Access Files (*.mdb)|*.mdb"
  84.     ctlCDialog.DefaultExt = "mdb"
  85.     ctlCDialog.Action = 2
  86.     strFileName = ctlCDialog.filename
  87.     On Error GoTo lblKillCatch
  88.     Kill strFileName
  89.     SetMousePointer MP_WAIT
  90.     CreateBlankDatabase strFileName
  91.     SetMousePointer MP_NORMAL
  92.     MsgBox strFileName & " Created.", MB_ICONINFORMATION, ""
  93.     Exit Sub
  94. lblNewDBaseErr:
  95.     MsgBox "Error creating blank database." & Chr(13) & Chr(10) & Error
  96.     Exit Sub
  97.     Resume Next
  98. lblNewDBaseCatchCancelErr:
  99.     Exit Sub
  100.     Resume Next
  101. lblKillCatch:
  102.     Resume Next
  103. End Sub
  104. Private Sub mnuFileOpen_Click()
  105. '----------------------------------------
  106. '--- mnuFileOpen_Click ------------------
  107. '--   The process for creating a network diagram requires we first prompt for
  108. '-- an Access database name.  If the user selects a file we then verify it
  109. '-- is OK for diagramming (ValidDatabase) and if so we create the diagram.
  110.     Dim strFileName As String
  111.     On Error GoTo lblFileOpenErr
  112.     ctlCDialog.DialogTitle = "Open Network Database"
  113.     ctlCDialog.Filter = "Access Files (*.mdb)|*.mdb"
  114.     ctlCDialog.CancelError = True
  115.     ctlCDialog.Action = 1
  116.     strFileName = ctlCDialog.filename
  117.     If ValidDatabase(strFileName) Then
  118.         SetMousePointer MP_WAIT
  119.         CreateDiagram (strFileName)
  120.         SetMousePointer MP_NORMAL
  121.     Else
  122.         MsgBox "Invalid Database", MB_ICONEXCLAMATION, "Open"
  123.     End If
  124.     Exit Sub
  125. lblFileOpenErr:
  126.     Exit Sub
  127.     Resume Next
  128. End Sub
  129.